<template>
    <div class="container">
      <el-form ref="form" :model="form[2]" label-width="110px">
          <div class="model-item">
            <div class="head">
              <span>模块一</span>
            </div>
            <div class="pr16">
                <el-form-item label="模块标题">
                    <el-input v-model="form[2].title"></el-input>
                </el-form-item>
                <el-form-item label="模块内容">
                    <el-input v-model="form[2].subtitle" type="textarea" :rows="3"></el-input>
                </el-form-item>
            </div>
          </div>
        </el-form>
      <el-form ref="form" :model="form[0]" label-width="110px">
          <div class="model-item">
            <div class="head">
              <span>模块二</span>
            </div>
            <div class="pr16">
                <el-form-item label="模块标题">
                    <el-input v-model="form[0].title"></el-input>
                </el-form-item>
            </div>
          </div>
        </el-form>
        <el-form ref="form" :model="form[1]" label-width="110px">
            <div class="model-item">
              <div class="head">
                <span>模块三</span>
              </div>
              <div class="pr16">
                  <el-form-item label="模块标题">
                      <el-input v-model="form[1].title"></el-input>
                  </el-form-item>
                  <el-form-item label="联系邮箱">
                      <el-input v-model="form[1].email"></el-input>
                  </el-form-item>
                  <el-form-item label="客服电话">
                      <el-input v-model="form[1].phone"></el-input>
                  </el-form-item>
              </div>
            </div>
          </el-form>
      <div class="save">
        <el-button type="primary" @click="handleSave" style="margin-top:16px;">保存</el-button>
      </div>
    </div>
  </template>
    <script>
  import { mapGetters } from "vuex";
  export default {
    name: "cartonConfig",
    components: {
    },
    data() {
      return {
        form:[],
        dialogImageUrl:[],
      };
    },
    computed: {
      ...mapGetters(["name"]),
    },
    created() {
    },
    mounted() {
      this.getData()
    },
    methods: {
      getData(){
          this.$api.system.GetList(0).then((res)=>{
          this.form = res
          })
        },
  
      handleSave(){
        this.$api.system.UpdateMore(this.form).then(res=>{
            this.$message.success('保存成功！')
            this.getData()
          })
      },
  
    },
  };
  </script>
    <style lang="scss" scoped>
  .container{
    padding:16px;
    overflow-y:auto;
    height:100%;
    $size:148px;
    .tips{
      font-size:13px;
      color:rgba(153, 153, 153, 1);
    }
  
    .save{
      display:flex;
      justify-content:center;
    }
    .modelBox{
      .model{
        display: none;
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width:$size;
        height:$size;
        border-radius:6px;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 2;
        >*{
          font-size: 20px;
          color: #fff;
          &:hover{
            color: #3f61f1;
          }
          &:not(:last-child){
            margin-right: 20px;
          }
        }
      }
      &:hover{
        .model{
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }
    }
    .el-upload{
      width: #{$size};
      height: #{$size};
      position: relative;
      .tag{
        position: absolute;
        left: 0;
        top: 0;
        padding: 4px 6px;
        line-height: 1.2em;
        background: rgba(0, 0, 0, 0.75);
        color: #fff;
        font-size: 12px;
        border-radius: 6px 0 4px 0;
        z-index: 2;
      }
    }
    .img_box{
      width: #{$size};
      height: #{$size};
      position: relative;
    }
    .img_boxMore{
      display: flex;
      flex-wrap: wrap;
      margin-right: -8px;
      margin-bottom: -8px;
      .img_box{
        border-radius:8px;
        border: 1px #dcdfe6 solid;
        overflow: hidden;
        margin-right: 8px;
      }
      >*{
        margin-right: 8px;
        margin-bottom: 8px;
      }
    }
  }
    .model-item{
      margin-top:10px;
      border:1px solid #e8e8e8;
      .head{
        margin-bottom:16px;
        padding-left:30px;
        display:flex;
        align-items:center;
        height:40px;
        background: rgba(253, 240, 255, 1);
      }
    }
  </style>
    